import {ElNotification, ElMessageBox} from "element-plus";

export function Notification(title, msg, type) {
    ElNotification({
        title: title, // Success
        message: msg, // message.
        type: type, // 类型(颜色)
    })
}

// TODO: 自定义MessageBox.
export const AlertMessageBox = (title, content, callback) => {

    ElMessageBox({
        title: title,
        message: content,
        dangerouslyUseHTMLString: true,
        showCancelButton: true,
        confirmButtonText: '复制',
        cancelButtonText: '关闭',
        beforeClose: (action, instance, done) => {
            // done 应该关闭窗口.
            if (action === 'confirm') {
                callback()
            }
            done()
        },
    })
}